﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ZWZ.Web.Install
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindDate();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var setting = Config.ConfigAdapter.SiteDataMgr.Groups["InitSetting"].Settings["HasInited"];
            setting.Value = true.ToString();
            Config.ConfigAdapter.SiteDataMgr.UpdateSetting(setting);
            BindDate();
        }

        protected void BindDate()
        {
            var setting = Config.ConfigAdapter.SiteDataMgr.Groups["InitSetting"].Settings["HasInited"];
            if (setting.Value == true.ToString())
            {
                Label1.Text = "安装完成！";
                Button1.Visible = false;
            }
            else
            {
                Label1.Text = "初始化安装";
                Button1.Visible = true;
            }
        }
    }
}